﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Cms.Web.CmsSystem
{
    public partial class InnerPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string url = "";
            string ID = EntLib.Request.GetString("id");
            if (!String.IsNullOrEmpty(ID))
            {
                //操作指定的记录
                BLL.TabPage bll = new Cms.BLL.TabPage();
                Model.Sys_Tabpage model = bll.GetById(ID, false);
                if (model != null)
                {
                    List<Model.Sys_Webpart> listwpt = bll.GetWebparts(model.Id);
                    switch (model.Tab_Type)
                    {
                        case Model.Sys_Tabpagetype.SysSolidForm:
                            url = model.Layout;
                            break;
                        case Model.Sys_Tabpagetype.WptList:
                            url = String.Format("/Tools/Aspx.ashx?catelog=tabpage&id={0}", ID);
                            break;
                        default:
                            ScriptUrl = model.Layout;
                            break;
                    }
                }
            }
            if (String.IsNullOrEmpty(url) && String.IsNullOrEmpty(ScriptUrl))
                Response.Write("欢迎您!");
            else if (!String.IsNullOrEmpty(url))
                Response.Redirect(url);

        }
        public string ScriptUrl { get; set; }
    }
}
